/* 
 * File:   Activity.cpp
 * Author: bd
 * 
 * Created on March 26, 2011, 2:45 PM
 */

#include "Activity.hpp"
#include <boost/thread.hpp>
#include <iostream>

Activity::Activity(const Activity& orig) :
config_(orig.config_), pool_(orig.pool_), name_(orig.name_)
{
}

Activity::Activity(const std::string& name, const Configuration& config, Pool<ShortMsgItem>& pool) :
config_(config), pool_(pool), name_(name)
{
}

Activity::~Activity()
{
}

void Activity::operator()()
{
    start();
}
void Activity::name(std::string name_)
{
    this->name_ = name_;
}
std::string Activity::name() const
{
    return name_;
}

void Activity::wait()
{
    boost::this_thread::sleep(boost::posix_time::seconds(config_.sleepDuration()));
}